package com.tengju.user.domain.model.archive.letax;

import com.fasterxml.jackson.annotation.JsonValue;

public enum LetaxWithdrawStatus {

    INIT(0, "申请中"), // 兼容老数据
    APPLIED(1, "申请中"),
    SENT(2, "已发放"),
    REJECTED(3, "审核拒绝"),
    APPROVED(4, "审核通过"),
    SEND_FAILED(5, "发放失败"),
    CANCELED(6, "已取消"),
    ACCOUNT_CHANGED(7, "账户已修改"),
    ;

    private int val;
    private String desc;

    LetaxWithdrawStatus(int val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    @JsonValue
    public int getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static LetaxWithdrawStatus formVal(int val) {
        LetaxWithdrawStatus result = null;
        for (LetaxWithdrawStatus status : LetaxWithdrawStatus.values()) {
            if (status.getVal() == val) {
                result = status;
            }
        }
        return result;
    }


}
